package org.cllib.tool;

public class Map {
	public final static int BLOCK_EMPTY = 0;
	public final static int BLOCK_OBSTACLE = 1;
	public final static int BLOCK_START = 2;
	public final static int BLOCK_END = 3;
	
	int[][] map;
	
	final int numRows , numCols;
	public Map(int numRows , int numCols){
		this.numRows = numRows;
		this.numCols = numCols;
		
		map = new int[numRows][numCols];
		
		reset();
	}
	
	public int getDataAt(int x , int y){
		return map[y][x];
	}
	
	public int getNumberOfRows(){
		return numRows;
	}
	
	public int getNumberOfCols(){
		return numCols;
	}
	
	public void setDataAt(int x, int y , int data){
		map[y][x] = data;
	}
	
	public void reset(){
		for (int i = 0; i < map.length; i++) {
			for (int j = 0; j < map[i].length; j++) {
				map[i][j] = BLOCK_EMPTY;
			}
		}
	}
}
